package com.magicsoft.share.adapter.article;

import android.support.annotation.LayoutRes;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.magicsoft.share.R;
import com.magicsoft.share.bean.share.ArticleType;

/**
 * Created by lyf on 2017/11/13/013.
 */

public class SortAdapter extends BaseQuickAdapter<ArticleType, BaseViewHolder> {
    private int selectPosition = 11;

    public SortAdapter(@LayoutRes int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, ArticleType item) {
        helper.setText(R.id.textView, item.getType_name());
        int layoutPosition = helper.getLayoutPosition();
        if (layoutPosition==selectPosition){
            helper.setChecked(R.id.radio,true);
        }else {
            helper.setChecked(R.id.radio,false);
        }
    }

    public int getSelectPosition() {
        return selectPosition;
    }

    public void setSelectPosition(int selectPosition) {
        this.selectPosition = selectPosition;

    }
}
